package net.lgpage.util;

import java.util.List;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.view.PagerAdapter;
import android.view.ViewGroup;

public class MyFragmentPagerAdapter extends FragmentPagerAdapter  {
    private List<Fragment> fragmentsList;

    public MyFragmentPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    public MyFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragments) {
        super(fm);
        this.fragmentsList = fragments;
    }
    public MyFragmentPagerAdapter(FragmentManager fm, List<Fragment> fragments,List<String>title_list) {
        super(fm);
        this.fragmentsList = fragments;
        this.list_Title = title_list;
    }
    @Override
    public int getCount() {
        return fragmentsList.size();
    }
    
    @Override
    public Fragment getItem(int arg0) {
        return fragmentsList.get(arg0);
    }
    
    @Override
    public int getItemPosition(Object object) {
        return PagerAdapter.POSITION_NONE;
    }


	@Override
	public Object instantiateItem(ViewGroup arg0, int arg1) {
		return super.instantiateItem(arg0, arg1);
	}

	@Override
	public void destroyItem(ViewGroup container, int position, Object object) {
		super.destroyItem(container, position, object);
	}
	 private List<String> list_Title;                              //tab名的列表
	//此方法用来显示tab上的名字  
    @Override  
    public CharSequence getPageTitle(int position) {  
        return list_Title.get(position % list_Title.size());  
    }  
	
    
}
